package com.lyrcsoft.applications.component;


import com.lyrcsoft.applications.Eoo;
import com.lyrcsoft.applications.Foo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 功能描述
 *
 * @author fujc-dev@qq.com
 * @date: 2023年11月27日 8:33
 */
@Component
//@Configuration
public class AppConfig {

	@Bean
	public Foo foo() {
		System.out.println("foo() invoked...");
		Foo foo = new Foo();
		System.out.println("foo() 方法的 foo hashcode: " + foo.hashCode());
		return foo;
	}

	@Bean
	public Eoo eoo() {
		System.out.println("eoo() invoked...");
		Foo foo = foo();
		System.out.println("eoo() 方法的 foo hashcode: " + foo.hashCode());
		return new Eoo();
	}

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
	}
}
